package com.todo.member.iface.backend.request;

import com.todo.common.common.entity.CurrentStaff;
import com.todo.common.utils.StringUtils;
import com.todo.member.iface.backend.base.MemberLevelReward;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * @author azhebuxing
 * @date 2025/2/12 19:41
 * @description
 */
@Data
public class UpdateMemberLevelInfoReq {

private CurrentStaff _staff;

    @Schema(title = "主键id", description = "主键id")
    private Long id;

    @Schema(title = "等级名称", description = "等级名称")
    private String levelName;

    @Schema(title = "等级描述", description = "等级描述")
    private String desc;

    @Schema(title = "升级规则", description = "升级规则")
    private String upgradeRule;

    @Schema(title = "等级关联特权", description = "等级关联特权")
    private List<String> levelPrivilege;

    @Schema(title = "等级关联权益", description = "等级关联权益")
    private MemberLevelReward levelReward;

    @Schema(title = "级别", description = "级别")
    private Integer level;

    public boolean baseCheck() {
        if (StringUtils.isBlank(levelName) || id == null || StringUtils.isBlank(desc) || level == null){
            return false;
        }
        if (levelReward != null){
            return levelReward.baseCheck();
        }
        return true;
    }
}
